/**
 * 
 */
package com.neal.web.controller;

import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.neal.domain.Preferences;


/**
 * @author Neal
 * @version 1.0
 * @description 
 */
@Controller
@RequestMapping("/form")
public class FormController {
	
	@RequestMapping(method=RequestMethod.GET)
	public String setpForm() {
		return "form/myForm";
	}
	
	@RequestMapping(method=RequestMethod.POST) 
	public String process(@ModelAttribute("preferences") Preferences preferences) {
		return "form/myForm";
	}
	
	@ModelAttribute
	public void getModel(Model model) {
		model.addAttribute("preferences",new Preferences());
	}
	
	
	@RequestMapping("/xxx/a")
	public String do1(@PathVariable Map<String, String> map, Model model) {
		return "form/myForm";
	}
}
